package com.xsoft.demo10;

import android.os.Parcel;
import android.os.Parcelable;

public class GoodsInfo implements Parcelable {
    private String name;
    private String detail;
    private String pictureAlbum;
    private String picture;
    private float price;
    private boolean isAdd;

    public GoodsInfo() {

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public String getPictureAlbum() {
        return pictureAlbum;
    }

    public void setPictureAlbum(String pictureAlbum) {
        this.pictureAlbum = pictureAlbum;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public boolean isAdd() {
        return isAdd;
    }

    public void setAdd(boolean add) {
        isAdd = add;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeString(this.detail);
        dest.writeString(this.pictureAlbum);
        dest.writeString(this.picture);
        dest.writeFloat(this.price);
        dest.writeByte(this.isAdd ? (byte) 1 : (byte) 0);
    }

    protected GoodsInfo(Parcel in) {
        this.name = in.readString();
        this.detail = in.readString();
        this.pictureAlbum = in.readString();
        this.picture = in.readString();
        this.price = in.readFloat();
        this.isAdd = in.readByte() != 0;
    }

    public static final Creator<GoodsInfo> CREATOR = new Creator<GoodsInfo>() {
        @Override
        public GoodsInfo createFromParcel(Parcel source) {
            return new GoodsInfo(source);
        }

        @Override
        public GoodsInfo[] newArray(int size) {
            return new GoodsInfo[size];
        }
    };
}
